<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="templates/template.xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:msh="http://java.sun.com/jsf/composite/msh">
    <ui:define name="title">
        <h:outputText value="#{msgs['listing.payingguest']}" escape="false"/>
    </ui:define>
    <ui:define name="content">
        <f:metadata>
            <f:event type="preRenderView" listener="#{loginController.authorize(3)}"/>
        </f:metadata>
        <script type="text/javascript">
            function pageLoad() {
                setSearchListing('rPayingGuest');
                showSearchPayingGuest();
            }
        </script>
        <div class="archive_list_wrapper">
            <h:form id="frmListing">
                <p:outputPanel id="pnlListing">
                    <h2 class="archive_list_main_title font_cufon" id="xxxele"><a name="head"><h:outputText value="#{msgs['listing.rentalbasis']}" escape="false"/></a></h2>
                    <div class="basic_style_1">
                        <h3><p><h:outputFormat value="#{msgs['listing.resultsFound']}">
                                    <f:param value="#{payingGuestController.pagination.resultSize}"/>
                                </h:outputFormat></p></h3>
                    </div>
                    <ul>
                        <ui:repeat value="#{payingGuestController.pagination.model}" var="adv">
                            <li class="archive_list clear_fix basic_style_1">
                                <h2 class="archive_list_title"><a target="_blank" href="detail.jsf?id=#{adv.advertisingID}">#{adv.title}</a></h2>

                                <div class="archive_list_content">
                                    <p class="post_listing_date"><h:outputText value="#{adv.postDate}"><f:convertDateTime dateStyle="default" timeStyle="default" type="both"/></h:outputText> <span>by <a href="#top"><b>#{adv.user.username}</b></a></span></p>
                                    <p class="post_sub_title"><b>#{adv.payingGuestAccommodation.city}</b> | #{adv.payingGuestAccommodation.location}</p>
                                    <p class="post_listing_price font_cufon">
                                        <h:outputText value="#{adv.payingGuestAccommodation.deposit}">
                                            <f:convertNumber currencySymbol="$ " type="currency" maxFractionDigits="0"/>
                                        </h:outputText>
                                        <span class="priceName"><h:outputText value="#{msgs['listing.deposit']}"/></span></p>
                                    <p class="post_listing_price font_cufon">
                                        <h:outputText value="#{adv.payingGuestAccommodation.rent}">
                                            <f:convertNumber currencySymbol="$ " type="currency" maxFractionDigits="0"/>
                                        </h:outputText> / Month
                                        <span class="priceName"><h:outputText value="#{msgs['listing.rent']}"/></span></p>
                                    <p id="rm#{adv.advertisingID}" style="text-align:right"><a target="_blank" href="detail.jsf?id=#{adv.advertisingID}">Read More &raquo;</a></p>
                                </div>
                            </li>
                        </ui:repeat>
                    </ul>
                    <msh:paginator formName="frmListing" pagination="#{payingGuestController.pagination}"/>
                </p:outputPanel>
            </h:form>            
        </div>
    </ui:define>
</ui:composition>